#ifndef _TARGET_H_
#define _TARGET_H_
#include "regx52.h"


extern void Blank(unsigned char ucLed);
extern void HC138Set(unsigned char ucCfg);
extern void delay(unsigned int usDelTick);
extern void SetLeds(unsigned char ucLed);
extern void ResetLeds(unsigned char ucLed);
extern void WriteLed(unsigned char ucLed,unsigned char Status);


#define BLK(ucLed)   {P0 ^= ucLed;HC138(4);HC138(0);}
#define HC138(ucCfg) {P2 = (ucCfg << 5) | (P2 & 0X1F);}
#define LedsSet(ucLed) {P0 &= ~ucLed;	HC138(4);HC138(0);}
#define LedsReset(ucLed) {P0 |= ucLed;	HC138(4);HC138(0);}
#define LedsWrite(ucLed,Status) {(Status)?(P0 &= ~ucLed;):(P0 |=  ucLed;);HC138Set(4);HC138Set(0);}

#endif
